home *** CD-ROM | disk | FTP | other *** search
- public class ClickExit extends Codex {
- private CodexThing exitThing = new CodexThing(((Codex)this).GetClassThing());
- private int _exitNumber;
- private String _locationName = "";
- private String originalDescID = "";
- private boolean bGotID;
- public static String[] _params = new String[]{"Exit number;0"};
-
- public void clicked(int guid, int clickerGuid, int captureID) {
- if (this.bGotID) {
- if (!CodexSequence.IsExitClosed(this._locationName, this._exitNumber)) {
- CodexSequence.TakeExit(this._exitNumber, clickerGuid);
- } else {
- new CodexSound("locked_large_02.WAV", 300.0F, 600.0F, 100, 0, 0, clickerGuid);
- CodexConsole.PrintNLS(clickerGuid, 0, "GEN_DOORLOCKED");
- }
-
- }
- }
-
- public ClickExit(int exitNumber) {
- this._exitNumber = exitNumber;
- }
-
- public void beginscene(int clientGuid, int captureID) {
- this.exitThing.SetThingFlags(2097152);
- CodexThing playerThing = new CodexThing(clientGuid);
- int locationNum = playerThing.GetLocationNum();
- this._locationName = CodexSequence.GetLocationName(locationNum);
- if (!this.bGotID) {
- this.originalDescID = this.exitThing.GetDescriptionID();
- this.bGotID = true;
- }
-
- if (!CodexSequence.IsExitValid(this._locationName, this._exitNumber)) {
- this.exitThing.SetThingFlags(64);
- } else {
- this.exitThing.ClearThingFlags(64);
- }
-
- if (CodexSequence.IsExitClosed(this._locationName, this._exitNumber)) {
- this.exitThing.SetDescriptionID(this.originalDescID + "_L");
- } else {
- this.exitThing.SetDescriptionID(this.originalDescID);
- }
-
- }
-
- public void restore(int flags) {
- this.bGotID = CodexSequence.RestoreBoolean();
- this.originalDescID = CodexSequence.RestoreString();
- this._locationName = CodexSequence.RestoreString();
- }
-
- public void save(int flags) {
- CodexSequence.SaveBoolean(this.bGotID);
- CodexSequence.SaveString(this.originalDescID);
- CodexSequence.SaveString(this._locationName);
- }
-
- public void exitstatechanged() {
- if (this.bGotID) {
- if (CodexSequence.IsExitClosed(this._locationName, this._exitNumber)) {
- this.exitThing.SetDescriptionID(this.originalDescID + "_L");
- } else {
- this.exitThing.SetDescriptionID(this.originalDescID);
- }
-
- }
- }
- }
-